	package ATM.logic;

import ATM.data.AdminData;
import ATM.gui.Screen;

public class TimerInterest extends Thread {
	Screen screen;

	// TimerInterest constructor contains BankDatabase reference
	public TimerInterest(Screen screen) {
		this.screen = screen;
	} // end constructor

	// start timer
	public void run() {
		AdminData adminData = new AdminData(screen);
		// loop while timer is running
		while (true) {
			adminData.addInterest();
			try {
				Thread.sleep(9000); // timer runs every 9 second
			} // end try
			catch (InterruptedException e) { // catch interrupted Exception
				// This method prints a stack trace for this Throwable object
				e.printStackTrace();
			} // end catch
		} // end while loop
	} // end timer

}
